]> dgit.raspbian.org Git - libreoffice.git/commitdiff
[PATCH] translate only file URLs
authorCaolán McNamara <caolan.mcnamara@collabora.com>
Fri, 12 Jun 2026 19:17:25 +0000 (19:17 +0000)
committerRene Engelhard <rene@debian.org>
Sat, 3 Oct 2026 10:46:08 +0000 (12:46 +0200)
Change-Id: I41076b8af670d673bf29b14c02db0c66744feb0b
Signed-off-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/4409
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
Reviewed-by: Stephan Bergmann <stephan.bergmann@collabora.com>
(cherry picked from commit 478eb7de0d14a05e6501bd44851f73ec0df5c59a)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/206635
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
(cherry picked from commit e663f8baed49976fd4d4d6d1c277ab036cd28736)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/206672

Gbp-Pq: Name CVE-2026-63277.diff

jvmaccess/source/classpath.cxx

index 95915196bad94a598f22c784491f613b84adfeba..bb0b16bc02206a802f9bd971a163353f1ba02fde 100644 (file)
@@ -29,6 +29,7 @@
 #include <com/sun/star/uno/Reference.hxx>
 #include <com/sun/star/uno/XInterface.hpp>
 #include <com/sun/star/uri/UriReferenceFactory.hpp>
+#include <com/sun/star/uri/XUriReference.hpp>
 #include <com/sun/star/uri/XVndSunStarExpandUrlReference.hpp>
 #include <com/sun/star/util/theMacroExpander.hpp>
 #include <cppuhelper/exc_hlp.hxx>
@@ -76,6 +77,14 @@ jobjectArray jvmaccess::ClassPath::translateToUrls(
                          nullptr, anyEx );
                 }
             }
+            css::uno::Reference< css::uri::XUriReference > uriRef(
+                css::uri::UriReferenceFactory::create(context)->parse(url));
+            if (!uriRef.is() || !uriRef->getScheme().equalsIgnoreAsciiCase("file"))
+            {
+                throw css::lang::IllegalArgumentException(
+                    "non-local Java class path entry: " + url,
+                    css::uno::Reference< css::uno::XInterface >(), 0);
+            }
             jvalue arg;
             arg.l = environment->NewString(
                 reinterpret_cast< jchar const * >(url.getStr()),